<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
</head>
<body>
  <script>
    //定义了一个对象
    //里面有属性和方法
  var info = {
    name:"why",
    age:18,
    friend:{
      name:"kobe",
      age:30
    },
    running: function() {
      console.log("running~")
    }
  }
  //访问对象的属性
  console.log(info.name)
  console.log(info.friend.name)
  info.running()//调用running

  //3.修改对象的属性
  info.age=25
  info.running=function() {
    alert("I am Running~")
  }
  
  console.log(info.age)
  info.running()

  //4.添加对象新的属性
  info.height=1.88
  info.studying=function() {
    console.log("I am Studing")
  }
  console.log(info.height)
  info.studying()

 //5.删除对象属性
 //delete关键字
 delete info.age
 delete info.height
 console.log(info) 
  </script>
</body>
</html>